import { createStore } from "vuex";
//这里放置全局状态管理
export default createStore(
    {
    cardE:{
        cardExist:''
    },
    account:{
        account_userid:'',
        account_email:'',
        account_firstname:'',
        account_lastname:'',
        account_status:'',
        account_addr1:'',
        account_addr2:'',
        account_city:'',
        account_state:'',
        account_zip:'',
        account_country:'',
        account_phone:'',
        account_favCategory:''
    },
    state:{
        product:{
            productName:''
        },
        item1:{
            itemId:'',
            productId:'',
            listPrice:'',
            unitCost: '',
            supplierId: '',
            status: '',
            attribute1:'',
            attribute2:'',
            attribute3:'',
            attribute4:'',
            attribute5:''
        },
        item2:{
            itemId2:'',
            productId2:'',
            listPrice2:'',
            unitCost2: '',
            supplierId2: '',
            status2: '',
            attribute12:'',
            attribute22:'',
            attribute32:'',
            attribute42:'',
            attribute52:''
        },
    },
    order:{
        //就是用这个东西去管理session
        Order_orderId:'',
        Order_username:'',
        Order_orderDate:'',
        Order_shipAddress1:'',
        Order_shipAddress2:'',
        Order_shipCity:'',
        Order_shipState:'',
        Order_shipZip:'',
        Order_shipCountry:'',
        Order_billAddress1:'',
        Order_billAddress2:'',
        Order_billCity:'',
        Order_billZip:'',
        Order_billCountry:'',
        Order_billState:'',
        Order_courier:'',
        Order_totalPrice:'',
        Order_billToFirstName:'',
        Order_billToLastName:'',
        Order_shipToFirstName:'',
        Order_shipToLastName:'',
        Order_creditCard:'',
        Order_expiryDate:'',
        Order_cardType:'',
        Order_locale:'',
        Order_status:'',
        Order_state:'',
        Order_sendOut:'',
        Order_lineItems:[
            {
                item:{
                    attribute1: "",
                    attribute2: "",
                    attribute3: "",
                    attribute4: "",
                    attribute5: "",
                    itemId: "",
                    listPrice: 0,
                    productId: "",
                    status: "",
                    supplierId: 0,
                    unitCost: 0
                },
                itemId: "",
                lineNumber: 0,
                orderId: 0,
                quantity: 0,
                total: '',
                unitPrice: 0
            },
            {
                item:{
                    attribute1: "",
                    attribute2: "",
                    attribute3: "",
                    attribute4: "",
                    attribute5: "",
                    itemId: "",
                    listPrice: 0,
                    productId: "",
                    status: "",
                    supplierId: 0,
                    unitCost: 0
                },
                itemId: "",
                lineNumber: 0,
                orderId: 0,
                quantity: 0,
                total: '',
                unitPrice: 0
            },
            {
                item:{
                    attribute1: "",
                    attribute2: "",
                    attribute3: "",
                    attribute4: "",
                    attribute5: "",
                    itemId: "",
                    listPrice: 0,
                    productId: "",
                    status: "",
                    supplierId: 0,
                    unitCost: 0
                },
                itemId: "",
                lineNumber: 0,
                orderId: 0,
                quantity: 0,
                total: '',
                unitPrice: 0
            }
        ]
    },
    //访问过滤，这里没有使用，可以对输出值进行控制
    getters: {
    },
    mutations: {
        setOrderOrderId(order,orderId){
            order.Order_orderId=orderId;
        },
        setOrderUsername(order,username){
            order.Order_username=username;
        },
        setOrderOrderDate(order,orderDate){
            order.Order_orderDate=orderDate;
        },
        setOrderShipAddress1(order,shipAddress1){
            order.Order_shipAddress1=shipAddress1;
        },
        setOrderShipAddress2(order,shipAddress2){
            order.Order_shipAddress2=shipAddress2;
        },
        setOrderShipCity(order,ShipCity){
            order.Order_shipCity=ShipCity;
        },
        setOrderShipState(order,shipState){
            order.Order_shipState=shipState;
        },
        setOrderShipZip(order,shipZip){
            order.Order_shipZip=shipZip;
        },
        setOrderShipCountry(order,shipCountry){
            order.Order_shipCountry=shipCountry;
        },
        setOrderBillAddress1(order,billAddress1){
            order.Order_billAddress1=billAddress1;
        },
        setOrderBillAddress2(order,billAddress2){
            order.Order_billAddress2=billAddress2;
        },
        setOrderBillCity(order,billCity){
            order.Order_billCity=billCity;
        },
        setOrderBillZip(order,billZip){
            order.Order_billZip=billZip;
        },
        setOrderBillCountry(order,billCountry){
            order.Order_billCountry=billCountry;
        },
        setOrderBillState(order,billState){
            order.Order_billState=billState;
        },
        setOrderCourier(order,courier){
            order.Order_courier=courier;
        },
        setOrderTotalPrice(order,totalPrice){
            order.Order_totalPrice=totalPrice;
        },
        setOrderBillToFirstName(order,billToFirstName){
            order.Order_billToFirstName=billToFirstName;
        },
        setOrderBillToLastName(order,billToLastName){
            order.Order_billToLastName=billToLastName;
        },
        setOrderShipToFirstName(order,shipToFirstName){
            order.Order_shipToFirstName=shipToFirstName;
        },
        setOrderShipToLastName(order,shipToLastName){
            order.Order_shipToLastName=shipToLastName;
        },
        setOrderCreditCard(order,creditCard){
            order.Order_creditCard=creditCard;
        },
        setOrderExpiryDate(order,expiryDate){
            order.Order_expiryDate=expiryDate;
        },
        setOrderCardType(order,cardType){
            order.Order_cardType=cardType;
        },
        setOrderLocale(order,locale){
            order.Order_locale=locale;
        },
        setOrderStatus(order,status){
            order.Order_status=status;
        },
        setOrderState(order,state){
            order.Order_state=state;
        },
        setOrderSendOut(order,sendOut){
            order.Order_sendOut=sendOut;
        },
        setOrderLineItems(order,lineItems){
            order.Order_lineItems=lineItems;
        },
        //item部分存储
        setItem1Attr1(item1, attr1) {
            item1.attribute1 = attr1;
        },
        setItem1Attr2(item1, attr2) {
            item1.attribute2 = attr2;
        },
        setItem1Attr3(item1, attr3) {
            item1.attribute3 = attr3;
        },
        setItem1Attr4(item1, attr4) {
            item1.attribute4 = attr4;
        },
        setItem1Attr5(item1, attr5) {
            item1.attribute5 = attr5;
        },
        setItem1Price(item1,price){
            item1.listPrice=price;
        },
        setItem1Product(item1,productId)
        {
            item1.productId=productId;
        },
        setItem1ItemId(item1,itemId)
        {
            item1.itemId=itemId;
        },
        setItem1State(item1,status)
        {
            item1.status=status;
        },
        setItem1Supplier(item1,supplierId)
        {
            item1.supplierId=supplierId;
        },
        setItem1UnitCost(item1,unitCost)
        {
            item1.unitCost=unitCost;
        },

        setItem2Attr1(item2, attr1) {
            item2.attribute12 = attr1;
        },
        setItem2Attr2(item2, attr2) {
            item2.attribute22 = attr2;
        },
        setItem2Attr3(item2, attr3) {
            item2.attribute32 = attr3;
        },
        setItem2Attr4(item2, attr4) {
            item2.attribute42 = attr4;
        },
        setItem2Attr5(item2, attr5) {
            item2.attribute52 = attr5;
        },
        setItem2Price(item2,price){
            item2.listPrice2=price;
        },
        setItem2Product(item2,productId)
        {
            item2.productId2=productId;
        },
        setItem2ItemId(item2,itemId)
        {
            item2.itemId2=itemId;
        },
        setProductId(product,productId)
        {
            product.productId2=productId;
        },
        setItem2State(item2,status)
        {
            item2.status2=status;
        },
        setItem2Supplier(item2,supplierId)
        {
            item2.supplierId2=supplierId;
        },
        setItem2UnitCost(item2,unitCost)
        {
            item2.unitCost2=unitCost;
        },
        setProductName(product,name)
        {
            product.productName=name;
        },
        setAccountUserid(account,userid)
        {
            account.account_userid=userid;
        },
        setAccountEmail(account,email)
        {
            account.account_email=email;
        },
        setAccountFirstName(account,firstname)
        {
            account.account_firstname=firstname;
        },
        setAccountLastName(account,lastname)
        {
            account.account_lastname=lastname;
        },
        setAccountStatus(account,status)
        {
            account.account_status=status;
        },
        setAccountAddr1(account,addr1)
        {
            account.account_addr1=addr1;
        },
        setAccountAddr2(account,addr2)
        {
            account.account_addr2=addr2;
        },
        setAccountCity(account,city)
        {
            account.account_city=city;
        },
        setAccountState(account,state)
        {
            account.account_state=state;
        },
        setAccountZip(account,zip)
        {
            account.account_zip=zip;
        },
        setAccountCountry(account,country)
        {
            account.account_country=country;
        },
        setAccountPhone(account,phone)
        {
            account.account_phone=phone;
        },
        setAccountfavCategory(account,favCategory)
        {
            account.account_favCategory=favCategory;
        },
        setCardExist(cardE,cardExist)
        {
            cardE.cardExist=cardExist;
        },
    }
})



